package com.road.down.pic;

import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import com.road.spider.JsoupRequest;
import com.road.spider.execution.Executor;
import com.road.spider.execution.ParserAction;

/**
 * @Description :
 * @FileName: PicParser.java
 * @Author :WeiHui.Zhang
 * @Data : 2016年3月10日 下午4:49:01
 * @Version:V1.00
 */
public class PicParser {

	final static String URL = "http://tu.duowan.com/lol";


	public static void main(String[] args) {

		int corePoolSize = 8;
		int maxPoolSize = 16;
		int keepAliveTime = 5;
		Executor executor = new Executor(corePoolSize, maxPoolSize, keepAliveTime, "parser");

		Document document = JsoupRequest.request(URL, true);

		System.out.println(document);

		Elements elements = document.getElementsByClass("box");

		for (Element element : elements) {

			System.out.println(element);

			executor.enDefaultQueue(new ParserAction(executor.getDefaultQueue(),element));
		}




	}
}
